package com.clayecloud.common.client.services.Impl;

import com.clayecloud.common.client.services.ReportForRepairService;
import com.clayecloud.common.entity.ReportForRepair;
import com.clayecloud.common.mappers.ReportForRepairMapper;
import com.clayecloud.common.utils.MessageUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author ClayeLink
 * @date 2022/4/6 14:23
 */
@Service
public class ReportForRepairServiceImpl implements ReportForRepairService {

    @Resource
    private ReportForRepairMapper reportForRepairMapper;

    @Override
    public MessageUtil insert(ReportForRepair record) {
        return reportForRepairMapper.insertSelective(record) > 0 ? MessageUtil.success("添加成功") : MessageUtil.fail("添加失败");
    }

    @Override
    public MessageUtil selectByUserId(Long userID) {
        return MessageUtil.success("查询成功").add(reportForRepairMapper.selectByUserId(userID));
    }
}
